<link href="{$base_dir}css/autocomplete.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src='{$base_dir}js/jquery.autocomplete.lhv.js'></script>
<script type="text/javascript" src='{$base_dir}js/FormValidations.js'></script>
<script type="text/javascript" src="{$base_dir}modules/dept_emer/js/AJAX_EmerReportDeadOutside.js"></script>
<script type="text/javascript">
{literal}

{/literal}
</script>

<div id="reportDeadOutsideDiv">
    <span class='formAlertMsg' id='statusMessage' style="padding-left: 5px;"></span>
    <form id="emerReceptionFrm">
        <input type="hidden" name="patientIdHdn" id="patientIdHdn" value="{$patientId}">
	    <table class='grid' cellspacing="0" cellpadding="0">
	    	<tr><th colspan='4' class='header'>{translate}Report on patient died outside hospital{/translate}</th></tr>
	        <tr>
	            <td class='form_label' style="width: 175px;">{translate}Patient name{/translate}</td>
	            <td  style="width: 185px;"><input id="patientNameTxt" name="patientNameTxt" type="text" value="{$patient->getName()}" style="width: 160px;"/></td>
	            <td class='form_label'  style="width: 75px;">{translate}Date of birth/Age{/translate}</td>
                   <td>
                       <input name="DOB_{$datePart_0}" id="DOB_{$datePart_0}" type="text" value="{$birthDays.0}" style="width: 21px;" onkeyup="return autoTab(this, 2, 'DOB_{$datePart_1}')" />
                       <span class='label'>-</span>
                       <input name="DOB_{$datePart_1}" id="DOB_{$datePart_1}" type="text" value="{$birthDays.1}" style="width: 21px;" onkeyup="return autoTab(this, 2, 'DOB_{$datePart_2}')">
                       <span class='label'>-</span>
                       <input name="DOB_{$datePart_2}" id="DOB_yyyy" type="text" value="{$birthDays.2}" style="width: 40px;" onkeyup="return autoTab(this, 4, 'personAgeTxt')" />
                       <span class='label'>&nbsp;/&nbsp;</span>
                       <input name="personAgeTxt" id="personAgeTxt" type="text" value="{$patient->getAge()}" style="width: 22px;"/>
                       <span class='form_label' style="width: 21px; color: #AAA;">({$datePart_0}-{$datePart_1}-{$datePart_2})</span>
                   </td>
	        </tr>
	        <tr>
                <td class='form_label'>{translate}Career{/translate}</td>
                <td>
                    <select name="careerLbx" id="careerLbx" style="width: 165px;">
                        <option value="-1" selected="selected">- - -</option>
                        {html_options options=$careerList selected=$patient->getCareer()}
                   </select>
                </td>
                   <td class='form_label'>{translate}Address{/translate}</td>
                   <td><input type="text" name="addressTxt" id="addressTxt" value="{$patient->getStreet()}" style="width: 295px"></td>
               </tr>
               <tr>
                   <td>&nbsp;</td>
				<td>
				    <select name="provinceLbx" id="provinceLbx" style="width: 165px;">
				        <option value="0" label="- - -">- {translate}Province/City{/translate} -</option>
				        {html_options options=$provinceList selected=$patient->getProvinceId()}
				    </select>
				</td>
				<td colspan="2">
				    <select name="districtLbx" id="districtLbx" style="width: 165px;">
				         <option value="0" label="- - -">- {translate}District{/translate} -</option>          
				        {html_options options=$districtList selected=$patient->getDistrictId()}
				    </select>&nbsp;&nbsp;  
				    <span class='label'>{translate}Ward{/translate}</span>&nbsp;
				    <input name="wardNameTxt" id="wardNameTxt" type="text" value="{$patient->getWardName()}" style="width: 140px;"/>
				</td>
               </tr>
              <tr>
                <td class='form_label'>{translate}Company/parents information{/translate}</td>
                <td colspan="3"><input type="text" name="relativeInfoTxt" id="relativeInfoTxt" value="{$deathInfo->get('relative_contacts')}" style="width: 420px;"></td>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Check-in time{/translate} (*)</td>
                   <td colspan="3">
                       <input name="checkIn_{$datePart_0}" id="checkIn_{$datePart_0}" type="text" value="{$checkInDate.0}" style="width: 22px;">
                       <span class='label'>-</span>
                       <input name="checkIn_{$datePart_1}" id="checkIn_{$datePart_1}" type="text" value="{$checkInDate.1}" style="width: 22px;">
                       <span class='label'>-</span>
                       <input name="checkIn_{$datePart_2}" id="checkIn_{$datePart_2}" type="text" value="{$checkInDate.2}" style="width: 40px;">
                       <span class='label'>&nbsp;&nbsp;</span>
                       <input name="checkInTimeTxt" id="checkInTimeTxt" type="text" value="{$checkInTime}" style="width: 40px;"/>
                       <span class='form_label' style="width: 21px; color: #AAA;">({$datePart_0}-{$datePart_1}-{$datePart_2} hh:mm)</span>
                   </td>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Injury description{/translate}</td>
                   <td colspan="3">
                       <table cellpadding="0" cellspacing="0">
                           <tr>
                               <td class='form_label'>{translate}Pulse{/translate}</td>
                               <td><input type="text" name="pulseTxt" id="pulseTxt" style="width: 70px;" value="{$deathInfo->getPulse()}">&nbsp;<span class='label'>{translate}times/minute{/translate}</span></td>
                               <td class='form_label'>{translate}Respiratory rate{/translate}</td>
                               <td><input type="text" name="respiratoryTxt" id="respiratoryTxt" style="width: 70px;" value="{$deathInfo->getRespiratory()}">&nbsp;<span class='label'>{translate}times/minute{/translate}</span></td>
                           </tr>
                           <tr>
                              <td class='form_label'>{translate}Pupillirary dimension{/translate}</td>
                              <td><input type="text" name="pupilDistanceTxt" id="pupilDistanceTxt" style="width: 70px;" value="{$deathInfo->getPupillaryDimension()}">&nbsp;<span class='label'>mm</span></td>
                              <td class='form_label'>{translate}Light reflection{/translate}</td>
                              <td><input type="text" name="lightReflectionTxt" id="lightReflectionTxt" style="width: 150px;" value="{$deathInfo->getLightReflection()}"></td>
                           </tr>
                           <tr>
                               <td class='form_label'>{translate}Other{/translate}</td>
                               <td colspan="3"><textarea rows="2" style="width: 100%;" name="otherInjuryDesTxt" id="otherInjuryDesTxt">{$deathInfo->getOtherDescription()}</textarea> </td>
                           </tr>
                       </table>
                   </td>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Emergency's action{/translate}</td>
                   <td colspan="3"><textarea rows="2" style="width: 424px;" name="emerActionTxt" id="emerActionTxt">{$deathInfo->get('medication_process')}</textarea> </td>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Diagnosis of death cause{/translate}</td>
                   <td colspan="3"><input type="text" name="deadCauseTxt" id="deadCauseTxt" style="width: 420px;" value="{$deathInfo->getDeathCaution()}"></td>
               </tr>
                <tr>
                   <td class='form_label'>{translate}Conclusion{/translate}</td>
                   <td colspan="3"><input type="text" name="conclusionTxt" id="conclusionTxt" style="width: 420px;" value="{$deathInfo->getConclusion()}"></td>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Patient's property{/translate}</td>
                   <td colspan="3"><textarea name="propertyTxt" id="propertyTxt" rows="2" style="width: 424px;">{$deathInfo->getPatientPossesion()}</textarea></td>
               </tr>
               <tr>
                   <th colspan="4" class='header'>{translate}Emergency aid giver's information{/translate}</th>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Name{/translate}</td>
                   <td><input id="aiderNameTxt" name="aiderNameTxt" type="text" value="{if $deathInfo->get('aid_giver_name') != ''}{$deathInfo->get('aid_giver_name')}{else}{$reception->getAiderName()}{/if}" style="width: 160px;"/></td>
                   <td class='form_label'>{translate}Phone number{/translate}</td>
                   <td><input id="aiderPhoneTxt" name="aiderPhoneTxt" type="text" value="{if $deathInfo->get('aid_giver_phone') != ''}{$deathInfo->get('aid_giver_phone')}{else}{$reception->getAiderPhone()}{/if}" style="width: 140px;"/></td>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Address{/translate}</td>
                   <td colspan="3"><input id="aiderAddressTxt" name="aiderAddressTxt" value="{if $deathInfo->get('aid_giver_address') != ''}{$emerDeathInfo->getAiderAddress()}{else}{$reception->getAiderAddress()}{/if}" type="text" style="width: 420px;"/></td>
               </tr>
               <tr>
               	<th colspan='4' class='header'>{translate}Reception doctors, nurses{/translate}</th>
               </tr>
               <tr>
                   <td class='form_label'>{translate}Reception doctor{/translate} (*)</td>
                   <td>
                       <select style="width: 165px;" name="doctorLbx" id="doctorLbx">
                           <option value="0">-  {translate}Doctor{/translate} -</option>
                           {html_options options=$doctorList selected=$deathInfo->getDoctorId()}
                       </select>
                   </td>
                   <td class='form_label'>{translate}Reception nurses{/translate}</td>
                   <td><input type='text' id='partiNurseTxt' name='partiNurseTxt' style='width: 295px' /></td>
               </tr>
               <tr>
               	<td class='form_label'>{translate}Internship doctors{/translate}</td>
               	<td colspan=3'><textarea rows="2" style='width: 424px' id='partiInternTxt' name='partiInternTxt'></textarea> </td>
                </tr>
               <tr>
                   <td colspan="4" align="right">
                       <div style="display: inline-table;">
                              <span id="msgSavingStatus" style="font-style: italic;"></span>&nbsp;&nbsp;
                       </div>
                       <div id="actionButtonDiv" style="display: inline-table;">
                           <input type="button" id="saveAndPrintReceptionInfoBtn" value="{translate}Save and print report{/translate}" onclick ="saveDeadOutsideInfo(true)">
                           &nbsp;<input type="button" id="saveReceptionInfoBtn" value="{translate}Save{/translate}" onclick ="saveDeadOutsideInfo(false)">
                       </div>
                       <div id="loaderDiv" style="display: none;">
                           <img src="{$base_uri}/images/ajax-loader.gif"/>
                       </div> 
                   </td>
               </tr>
	    </table>	       
       </form>
</div>